package com.newland.flow.effect
{
	import flash.events.MouseEvent;
	
	import mx.effects.Glow;

	public class EffectUtil
	{
		private var glow:Glow = new Glow;
		private var unGlow:Glow = new Glow;
		
		public function EffectUtil()
		{
			glow.duration = 1500;
			glow.alphaFrom = 0.0;
			glow.alphaTo = 1.0;
			glow.blurXFrom = 50.0;
			glow.blurXTo = 0;
			glow.blurYFrom = 50.0;
			glow.blurYTo = 0;
			//glow.color = 0x00FF00;
			glow.color = 0x0000ff;
			
			unGlow.duration = 0;
			unGlow.alphaFrom = 0.0;
			unGlow.alphaTo = 0.0;
			unGlow.blurXFrom = 0.0;
			unGlow.blurXTo = 0;
			unGlow.blurYFrom = 0.0;
			unGlow.blurYTo = 0;
			unGlow.color = 0xffffff;
		}
		public function rollOverEffect(event:MouseEvent,targets:Array):void {
			glow.repeatDelay = 1;
			glow.repeatCount = 9999;
			glow.play(targets,false);
		}
		public function rollOutEffect(event:MouseEvent,targets:Array):void {
			glow.stop();
			unGlow.play(targets,false);
		}
	}
}